﻿@model HCQ2_Model.T_Permissions
@{
    ViewBag.Title = "权限管理";
}
@section headerSection{
    <style>
        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-left: 5px;
        }
    </style>
}
<div class="animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins" style="margin-bottom: 0px;">
        <div class="ibox-content" style="padding: 5px 20px 0px 20px;">
            <div class="row row-lg">
                <div class="col-sm-12 col-sm-leftRight">
                    <!-- Example Toolbar -->
                    <div class="example">
                        <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                            @{
                                List<string> folderList = (List<string>)ViewBag.elementList;
                                if (folderList.Contains("limitDetail"))
                                {
                                    <button id="limitDetail" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-th-large" aria-hidden="true">详细</i>
                                    </button>
                                }
                                if (folderList.Contains("limitAdd"))
                                {
                                    <button id="limitAdd" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true">新增</i>
                                    </button>
                                }
                                if (folderList.Contains("limitEdit"))
                                {
                                    <button id="limitEdit" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true">编辑</i>
                                    </button>
                                }
                                if (folderList.Contains("limitDel"))
                                {
                                    <button id="limitDel" type="button" class="btn btn-outline btn-danger">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true">删除</i>
                                    </button>
                                }
                                if (folderList.Contains("btnSearch"))
                                {
                                    <div class="form-group">
                                        <input id="perName" name="perName" type="text" class="form-control" placeholder="请输入权限名称">
                                    </div>
                                    <div class="form-group" style="width:150px;">
                                        <select id=perType title="请选择权限类别" name="perType" class="selectpicker show-tick bs-select-hidden" data-live-search="true"  placeholder="请选择权限类别">
                                            <option value="" selected>全部</option>
                                            <option value="menu">菜单权限</option>
                                            <option value="element">元素权限</option>
                                            @*<option value="fieldManager">字段权限</option>*@
                                            <option value="docMenu"> 目录导航权限</option>
                                            @*<option value="docSystem">文档管理员权限</option>*@
                                            @*<option value="docManager">文档权限</option>*@
                                            <option value="ModuleManager">模块权限</option>
                                        </select>
                                    </div>
                                    <div class="form-group" style="margin-top:-2px;width:150px;">
                                        <select id="smCode" name="smCode" title="请选择所属模块" class="form-control show-tick selectpicker" placeholder="请选择所属模块">
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                                    </div>
                                }
                                if (folderList.Contains("btnLimit"))
                                {
                                    <div class="form-group">
                                        <button id="btnLimit" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-star"></i>&nbsp;权限设置</button>
                                    </div>
                                }
                            }
                        </div>
                        <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
                    </div>
                    <!-- End Example Toolbar -->
                </div>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!-- 添加/编辑 -->
<div id="limitForm" style="width: 430px; overflow: hidden; display: none;">
    <form class="form-horizontal m-t" id="limitFormTable" method="post">
        <div class="form-group">
            <label class="col-sm-4 control-label">权限名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="per_name" name="per_name" type="text" class="form-control input-sm" placeholder="请输入权限名称" title="请输入权限名称" required="" aria-required="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">权限类别<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=per_type title="请选择权限类别" name="per_type" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择权限类别">
                    <option value="menu" selected>菜单权限</option>
                    <option value="element">元素权限</option>
                    @*<option value="fieldManager">字段权限</option>*@
                    <option value="docMenu">目录导航权限</option>
                    @*<option value="docSystem">文档管理员权限</option>
                    <option value="docManager">文档权限</option>*@
                    <option value="ModuleManager">模块权限</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">权限代码<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="per_code" name="per_code" type="text" class="form-control input-sm" placeholder="请输入权限代码" title="请输入权限代码" required="" aria-required="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">所属模块<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=sm_code title="请选择所属模块" name="sm_code" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择所属模块">
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">是否需要接口验证<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=ver_port title="请选择接口验证" name="ver_port" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择接口验证">
                    <option value="false" selected>不需要接口验证</option>
                    <option value="true">需要接口验证</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">备注：</label>
            <div class="col-sm-7">
                <textarea class="form-control" id="per_note" name="per_note" rows="3" placeholder="请输入备注信息" title="请输入备注信息"></textarea>
            </div>
        </div>
    </form>
</div>
@section footSection{
    <script src="~/Resources/myScript/SysAdmin/sysLimit.js"></script>
    <script>
        $(function () {
            limitManager.initSelect();
            //初始化Table
            limitManager.initTable();
            //绑定事件
            limitManager.bindEvent();
        });
    </script>
}
